//
//  HJChatMessageFirstReplyCell.m
//  KaiChat
//
//  Created by lx on 2023/12/25.
//

#import "HJChatMessageFirstReplyCell.h"
#import "HJChatMessageFirstReplyLayout.h"
#import "HJChatMessageModel.h"
#import "HJGradientView.h"
#import "QMUIButton.h"

@interface HJChatMessageFirstReplyCell()

@property (nonatomic, weak) UILabel *contentLabel;
@property (nonatomic, weak) UILabel *titleLabel;

@end


@implementation HJChatMessageFirstReplyCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
 
        UILabel *titleLabel = [UILabel lableWithSuperView:self.bubbleView font:UIFontMediumMake(14) color:UIColor.tj_333333Color title:nil textAlignment:NSTextAlignmentLeft];
        
        UILabel *contentLabel = [UILabel addToView:self.bubbleView];
        contentLabel.textAlignment = NSTextAlignmentLeft;
        contentLabel.textColor = UIColor.tj_868391Color;
        contentLabel.numberOfLines = 0;
        
        _contentLabel = contentLabel;
        _titleLabel = titleLabel;
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    HJChatMessageFirstReplyLayout *messageFirstReplyLayout = (HJChatMessageFirstReplyLayout *)self.messageLayout;
    _titleLabel.frame = messageFirstReplyLayout.titleLabelRect;
    _contentLabel.frame = messageFirstReplyLayout.contentRect;
}

- (void)setMessageLayout:(HJChatMessageLayout *)messageLayout {
    [super setMessageLayout:messageLayout];
    
    HJChatMessageFirstReplyLayout *messageFirstReplyLayout = (HJChatMessageFirstReplyLayout *)messageLayout;
    self.titleLabel.font = messageFirstReplyLayout.titleLabelFont;
    self.contentLabel.font = messageFirstReplyLayout.contenFont;
    self.contentLabel.attributedText = messageFirstReplyLayout.attributedString;
    self.titleLabel.text = messageFirstReplyLayout.messageModel.msg;
}


@end


